package com.wiegand.content.overlay {
	import com.wiegand.loader.SwfLoader;

	import flash.display.Sprite;

	/**
	 * @author gandy
	 */
	public class Shadows extends Sprite {

		private var _cornerTL : Sprite;
		private var _cornerTR : Sprite;
		private var _cornerBL : Sprite;
		private var _cornerBR : Sprite;
		private var _gradientWallT : Sprite;
		private var _gradientWallB : Sprite;
		private var _gradientFloor : Sprite;

		public function Shadows() {
		}
		
		public function init() : void {
			
			_cornerTL = SwfLoader.getInstance().getDisplayObject("ShadowCornerTL") as Sprite;
			_cornerTL.alpha = 0.65;
			_cornerTL.mouseEnabled = false;
			addChild(_cornerTL);
			
			_cornerTR = SwfLoader.getInstance().getDisplayObject("ShadowCornerTR") as Sprite;
			_cornerTR.alpha = 0.65;
			_cornerTR.x = stage.stageWidth;
			_cornerTR.mouseEnabled = false;
			addChild(_cornerTR);
			
			_cornerBL = SwfLoader.getInstance().getDisplayObject("ShadowCornerBL") as Sprite;
			_cornerBL.alpha = 0.65;
			_cornerBL.y = stage.stageHeight;
			_cornerBL.mouseEnabled = false;
			addChild(_cornerBL);
			
			_cornerBR = SwfLoader.getInstance().getDisplayObject("ShadowCornerBR") as Sprite;
			_cornerBR.alpha = 0.65;
			_cornerBR.x = stage.stageWidth;
			_cornerBR.y = stage.stageHeight;
			_cornerBR.mouseEnabled = false;
			addChild(_cornerBR);
			
			_gradientWallT = SwfLoader.getInstance().getDisplayObject("ShadowGradientT") as Sprite;
			_gradientWallT.alpha = 0.65;
			_gradientWallT.height = stage.stageHeight*0.5;			
			_gradientWallT.width = stage.stageWidth;
			_gradientWallT.mouseEnabled = false;
			addChild(_gradientWallT);
			
			_gradientWallB = SwfLoader.getInstance().getDisplayObject("ShadowGradientB") as Sprite;
			_gradientWallB.alpha = 0.5;
			_gradientWallB.width = stage.stageWidth;
			_gradientWallB.y = stage.stageHeight*0.75;
			_gradientWallB.mouseEnabled = false;
			addChild(_gradientWallB);
			
			_gradientFloor = SwfLoader.getInstance().getDisplayObject("ShadowGradientT") as Sprite;
			_gradientFloor.alpha = 0.4;
			_gradientFloor.width = stage.stageWidth;
			_gradientFloor.y = stage.stageHeight*0.75;
			_gradientFloor.mouseEnabled = false;
			addChild(_gradientFloor);
			
			this.mouseEnabled = false;

		}
		
		public function resize():void {	
			_cornerTR.x = stage.stageWidth;
			_cornerBL.y = stage.stageHeight;
			_cornerBR.x = stage.stageWidth;
			_cornerBR.y = stage.stageHeight;
			_gradientWallT.height = stage.stageHeight*0.5;			
			_gradientWallT.width = stage.stageWidth;
			_gradientWallB.width = stage.stageWidth;
			_gradientWallB.y = stage.stageHeight*0.75;
			_gradientFloor.width = stage.stageWidth;
			_gradientFloor.y = stage.stageHeight*0.75;			
		}
	}
}
